from random import randrange as rand

class Deck:
	u"Talia i jej metody"
	def __init__(self):
		self.figures = ["A", "K", "Q", "J", "10", 
		"9", "8", "7", "6", "5", "4", "3", "2"]
		self.colors = ["pik", "kier", "karo", "trefl"]
		self.cards = []
		for i in range(len(self.figures)):
			for j in range(len(self.colors)):
				self.cards.append("%s-%s" % (self.figures[i], self.colors[j]))
		self.current = self.cards
	def Reset(self):
		self.current = self.cards
	def Give(self, count):
		self.pick_set = []
		for i in range(count):
			x = rand(0, len(self.current), 1)
			pick = self.current[x]
			self.current.remove(pick)
			self.pick_set.append(pick)
		return self.pick_set
	def Digitize(self, cards):
		dcards = []
		for i in range(len(cards)):
			c = cards[i][0]
			if c.isdigit():
				if int(c) == 1:
					dcards.append(10)
				else:
					dcards.append(int(c))
			elif c == 'A':
				dcards.append(14)
			elif c == 'K':
				dcards.append(13)
			elif c == 'Q':
				dcards.append(12)
			elif c == 'J':
				dcards.append(11)
		return dcards
